<form action="/collaboration/reference/process.jsp" method="post">
<input type="hidden" name="referenceID" value="<%=rid%>" />
	<div class="form-line">
		<div class="title">
			<label for="type">Type:</label>
		</div>
		<div class="box">
		<% String referencetype = ""+ r.getType(); referencetype = referencetype.toLowerCase();%>
			<select name="type" id="<%=(request.getParameter("formprefix")!=null)?request.getParameter("formprefix"):"" %>attrType" onchange="<%=onchangeformjscode%>">
				<option value="0" <%=(referencetype.equals("article"))?"selected=\"selected\"": "" %>>Article</option>
				<option value="1" <%=(referencetype.equals("book"))?"selected=\"selected\"": "" %>>Book</option>
				<option value="2" <%=(referencetype.equals("booklet"))?"selected=\"selected\"": "" %>>Booklet</option>
				<option value="3" <%=(referencetype.equals("conference"))?"selected=\"selected\"": "" %>>Conference</option>
				<option value="4" <%=(referencetype.equals("inbook"))?"selected=\"selected\"": "" %>>Inbook</option>
				<option value="5" <%=(referencetype.equals("incollection"))?"selected=\"selected\"": "" %>>Incollection</option>
				<option value="6" <%=(referencetype.equals("inproceedings"))?"selected=\"selected\"": "" %>>Inproceedings</option>
				<option value="7" <%=(referencetype.equals("manual"))?"selected=\"selected\"": "" %>>Manual</option>
				<option value="8" <%=(referencetype.equals("masterthesis"))?"selected=\"selected\"": "" %>>Mastersthesis</option>
				<option value="9" <%=(referencetype.equals("misc"))?"selected=\"selected\"": "" %>>Misc</option>
				<option value="10" <%=(referencetype.equals("phdthesis"))?"selected=\"selected\"": "" %>>Phdthesis</option>
				<option value="11" <%=(referencetype.equals("proceedings"))?"selected=\"selected\"": "" %>>Proceedings</option>
				<option value="12" <%=(referencetype.equals("techreport"))?"selected=\"selected\"": "" %>>Techreport</option>
				<option value="13" <%=(referencetype.equals("unpublished"))?"selected=\"selected\"": "" %>>Unpublished</option>
			</select>
		</div>
	</div>
	
	<% String[][] textfields={{"label", r.getLabel()},
							  {"title", r.getTitle()},
							  {"authors", r.getAuthors()},
							  {"booktitle", r.getBooktitle()},
							  {"editor", r.getEditor()},
							  {"publisher", r.getPublisher()},
							  {"organization", r.getOrganization()},
							  {"school", r.getSchool()},
							  {"journal", r.getJournal()},
							  {"year", r.getYear()},
							  {"volume", r.getVolume()},
							  {"number", r.getNumber()},
							  {"pages", r.getPages()},
							  {"month", r.getMonth()},
							  {"note", r.getNote()},
							  {"series", r.getSeries()},
							  {"address", r.getAddress()},
							  {"edition", r.getEdition()},
							  {"isbn", r.getIsbn()},
							  {"howpublished", r.getHowpublished()}};
	
		for (String[] name : textfields) {
	%>
	<div class="form-line field" id="<%=(request.getParameter("formprefix")!=null)?request.getParameter("formprefix"):"" %>field_<%=name[0]%>">
		<div class="title">
			<label for="<%=name[0]%>">
			<%=name[0].substring(0,1).toUpperCase()+name[0].substring(1)%><span id="<%=(request.getParameter("formprefix")!=null)?request.getParameter("formprefix"):"" %>star<%=name[0]%>"></span> :
			</label>
		</div>
		<div class="box">
			<input type="text" name="<%=name[0]%>" id="<%=(request.getParameter("formprefix")!=null)?request.getParameter("formprefix"):"" %><%=name[0]%>" value="<% if (name[1] != null && !name[1].equals("null")) { %><%=name[1]%> <% } %>" placeholder="<%=name[0].substring(0,1).toUpperCase()+name[0].substring(1)%>"/>
		</div>
	</div>
	<% } %>
	
	<div class="form-line">
		<div class="form-note centered">The fields marked with * are required.</div>
	</div>
	
	<div class="form-line submit-center">
		<input type="submit" value="Save" />
	</div>
</form>
